package org.example.exampreparationtreasure.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

public enum QuestionType {
    SINGLE_CHOICE("单选题"),
    MULTIPLE_CHOICE("多选题"),
    JUDGMENT("判断题"),
    FILL_IN_THE_BLANK("填空题"),
    SHORT_ANSWER("简答题");
    @EnumValue
    private final String description;
    QuestionType(String description) {
        this.description = description;
    }
    public String getDescription() {
        return description;
    }
    public static QuestionType fromDescription(String description) {
        for (QuestionType type : QuestionType.values()) {
            if (type.getDescription().equals(description)) {
                return type;
            }
        }
        return null;
    }
}
